[minor] Implement Redis-Based Distributed Locking for GitOps Operations#2189
Merged
[minor] Implement Redis-Based Distributed Locking for GitOps Operations#2189
Conversation
image/cli/mascli/functions/gitops_suite_app_config - Migrated image/cli/mascli/functions/gitops_mas_config - Migrated image/cli/mascli/functions/gitops_deprovision_app_config - Migrated
whitfiea
requested changes
Apr 17, 2026
clarify that Redis env vars must be set whenever migrated GitOps functions are executed, not only in IBM Toolchain note that IBM Toolchain is optional and document pipeline environment properties as one way to provide runtime variables remove the custom CLI image/container setup section because custom CLI images are not supported
whitfiea
requested changes
Apr 20, 2026
If Redis is available → Uses Redis locking If Redis is unavailable → Automatically falls back to Git locking
whitfiea
requested changes
Apr 21, 2026
… updated behavior to error when Redis is unavailable with explicit Redis locking enabled.
whitfiea
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
https://jsw.ibm.com/browse/MASCORE-13109
Description
This PR implements a comprehensive Redis-based distributed locking mechanism to replace the legacy Git branch-based locking system for GitOps operations. The change addresses critical issues with concurrent pipeline executions that previously caused race conditions, merge conflicts, and branch pollution.
Key Changes
1. Redis Locking Infrastructure (
image/cli/mascli/functions/gitops_utils)SET NXoperationsGITOPS_USE_REDIS_LOCKING=false(Git branch locking) to avoid breaking changesGITOPS_USE_REDIS_LOCKING=trueto enable Redis locking (fails if Redis unavailable)2. Container Image Updates
redis-cliinstallation script (image/cli/install/install-redis-cli.sh)3. Migrated GitOps Functions (10 functions)
All functions now support
gitops_lock_and_modifywith Redis locking (opt-in):gitops_cp4d_servicegitops_suite_app_configgitops_deprovision_app_configgitops_mas_configgitops_suite_workspacegitops_deprovision_suite_workspacegitops_deprovision_cp4d_servicegitops_db2u_databasegitops_rds_db2_databasegitops_deprovision_db2u_database4. Documentation
docs/redis-locking-setup.md)docs/ibm-toolchain-redis-setup.sh)Impact
Reliability Improvements (when Redis enabled):
Non-Breaking Change:
GITOPS_USE_REDIS_LOCKING=falseuses existing Git branch lockingGITOPS_USE_REDIS_LOCKING=trueto enable Redis lockingTest Results
Manual Testing
Integration Testing
Configuration Testing
ibm-toolchain-redis-setup.sh)Backporting
Related Pull Requests
https://github.ibm.com/maximoappsuite/saas-deploy-py/pull/262
GITOPS_USE_REDIS_LOCKING=false) maintains existing Git branch lockingGITOPS_USE_REDIS_LOCKING=truedocs/redis-locking-setup.mddocs/ibm-toolchain-redis-setup.shfor IBM Cloud integration